<?
/*-- Project Introduce --*/


/**
 * What's this Class ?
 *
 * @author		alee
 * @access		public
 */
class JCAT_CLPP_NamedParamStyle implements JCAT_ICommandLineParamParser
{
	/**
	 * 
	 *
	 * @access	public
	 * @param 	$arrCLParams	array
	 * @return	array
	 */
	public function Parse(array $arrCLParams,$sAnonymity='default')
	{
		// 第一项 参数为 脚本路径
		array_shift($arrCLParams) ;
		
		$arrRet = array() ;
		$nAnonymousKey = 0 ;
		
		foreach($arrCLParams as $sArgValue)
		{
			$nPos=strpos($sArgValue,'=');
			if($nPos<0)
			{
				$arrRet[$sAnonymity.($nAnonymousKey++)] = $sArgValue ;
			}
			else
			{
				$sName = substr($sArgValue,0,$nPos) ;
				$arrRet[$sName] = substr($sArgValue,$nPos+1) ;
			}
		}
		
		return $arrRet ;
	}
}

?>